<template>
    <div>
        <h1>我是登录页面</h1>
        <label>账号: <input type="text" v-model="userObj.user"> </label><br>
        <label>密码: <input type="text" v-model="userObj.pwd"> </label><br>
        <button @click="userLogin">登录</button>
    </div>
</template>
<script>
import utils from '../utils/utils'
export default {
    data() {
        return {
            userObj:{
                user:'',
                pwd:''
            }
        }
    },
    methods: {
        userLogin(){
            let {user,pwd} = this.userObj
            utils.setStorage('user',this.userObj)
            this.$router.push('/home')            
        }
    },
}
</script>